import requests

# POST——data
# p = requests.post('http://127.0.0.1:8000/api/user/', data={'username': 'liz', 'password': '123123'})
# p.raise_for_status()
# print(p.json())

# GET——data
# p = requests.get('http://127.0.0.1:8000/api/user/')
# p.raise_for_status()
# print(p.json())

# 上传文件
files = {'file': open('movie.txt', 'rb'), 'file1': open('readme.md')}
f = requests.post('http://127.0.0.1:8000/upload/', files=files)
print(f.text)
